package com.itheima.sc.web.order;

import com.itheima.sc.pojo.order.OmsOrderSetting;
import com.itheima.sc.result.Result;
import com.itheima.sc.service.order.OmsOrderSettingService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("orderSetting")
public class OmsOrderSettingController {
    @Autowired
    OmsOrderSettingService omsOrderSettingService;
    //获取详情
    @GetMapping("{id}")
    public Result getSettingById(@PathVariable Long id){
        return omsOrderSettingService.getById(id);
    }

    @PostMapping("update/{id}")
    public Result updateSettingById(@PathVariable Long id,@RequestBody OmsOrderSetting omsOrderSetting){
        omsOrderSettingService.updateSetting(id,omsOrderSetting);
        return Result.success("修改成功");
    }
}
